Git Fixes
Error: Unable to load Commits. fatal: bad object desktop.ini
Summary: Bad desktop.ini file that is created by Google Drive. Needs to be deleted.
Delete all desktop.ini files
- Run CMD as administrator
- Navigate to the folder where the bad file is using
cd
- Delete all "desktop.ini" files in the folder and all sub-folders using
del desktop.ini /A:H /S
- Reload the git graph extension and the error should have gone
Manually delete each desktop.ini file with explanations
- Run CMD as administrator
- Navigate to the folder where the bad file is using
cd
- Show all files in the folder along with their marked attributes using
attrib
- Any hidden file has an "H" file attribute next to it
- Remove the hidden attribute of the file using
attrib -h desktop.ini
. Note, if there are more than one attribute, you need to remove all of them for this command to work (see link 3) - Delete the file using
del desktop.ini
- Continue for all files that need to be deleted
- Reload the git graph extension and the error should have gone
References
Clearing Secrets from History
Summary:
- Create a text file at the parent folder of the repo (not in the repo) of the replacements you need to make such as "BigLynnReplacements.txt"
- Each line is a new replacement, e.g.;
‘xau_8Q9v6YrRzXgPcSvgjOvVbYEwkKm1lgBo4’==>ENV[‘XATA_API_KEY’]
would replace the API key with the environment variable name - Copy the file "git-filter-repo" from Personal Coding into the repo
- Open the CMD for the repo
- Use the command
git filter-repo --replace-text ../BigLynnReplacements.txt --force
to go through the history of the repo and make all the required replacements
References